1. Field of the Invention
The present invention relates to graphical, event-driven computer systems, more particularly to menu management in a computer system having a graphical user interface.
2. State of the Art
A large amount of effort has been devoted to improving the ease of using computer systems. One area where this is especially evident is that of computer user interfaces. For example, the use of windows, icons and pull-down, pop-up, or tear-off menus greatly enhances the ease of using a computer system. Pull-down menus, for instance, contain commands which are logically grouped so that specific commands may be located and executed quickly.
The term "menu" is used to refer to a graphical representation of a collection of related items consisting of text, pictures or other symbols. Each item can be either in a non-highlighted or highlighted state, which allows a user to interactively choose an item from a menu, with feedback indicated by a single highlighted item in the menu that indicates to the user what his or her current selection is.
One computer system which makes extensive use of pull-down menus is the Macintosh computer system manufactured by Apple Computer, Inc. In the Macintosh operating system, a mechanism is provided wherein multiple pull-down menus may be used at the operating system level or by application programs. In this system, each individual menu and each menu command is defined by embedded computer code which is compiled at the time of creating a program or whenever updating the computer operating system. (The term "window" is used herein to denote self-contained drawing environments as in the Macintosh computer.)
Especially useful are hierarchical menus and tear-off menus. Hierarchical menus are menus that contain sub-menus. In particular, some menu items have sub-menus associated with them which allow users to navigate through multiple levels of menus and sub-topics. As the user selects items with sub-menus, the sub-menus are temporarily displayed after a short delay to allow users to select from the items in the sub-menu. Tear-off menus are menus that may be removed from the menu bar and drawn as windows on the display screen. The menu window may then be repositioned on the display screen or may be closed and thereby removed from the screen. In effect, a tear-off menus is a persistent copy of a normal menu that remains visible after the menu selection process is complete. Tear-off menus can only be dismissed by an explicit user action. Tear-off menus are the subject of U.S. Pat. No. 4,931,783 to Atkinson, assigned to Apple Computer and incorporated herein by reference, and are used in the Hypercard and MacPaint application programs available from Apple Computer as well as in numerous other application programs.
Hierarchical menus are supported extensively by Macintosh system software, principally by the Menu Manager. Tear-off menus, on the other hand, have not been explicitly supported by system software. Rather, providing tear-off menus, if desired, has been the responsibility of individual applications, requiring a significant amount of application code. Associated with such code is an equally significant amount of processing overhead, since hierarchical menus and tear-off menus have been provided for separately.
This situation is illustrated in FIG. 1. Although the description of FIG. 1 and subsequent figures most closely describes the Macintosh system software, the same principles are applicable to other operating system environments and to any graphical, event-driven computer system. In FIG. 1, an Event Manager 11 responds to user input events such as keyboard events and mouse events. These events are passed to an application program 15. A sequence of such events might represent a tear-off gesture, for example, by which a user indicates a desire to tear-off a menu to create a persistent copy displayed within a menu window. The application must be able to recognize and respond to the tear-off gesture. Program code 19 is provided within the application for this purpose. In response to the tear-off gesture, the application program makes calls to a collection of window display routines (the Window Manager 23) and a collection of menu management routines (the Menu Manager 25) to provide and display to the user the appropriate menu behavior. The Window Manager 23 and the Menu Manager 25 in turn make calls to code resources 17 and 21 within the application that specify window and menu contents and arrangement. Typically, these resources are in the form of window definition files and menu definition files, "WDEFs" and "MDEFs," respectively. The Window Manager and the Menu Manager then make calls to a collection of drawing routines 27, such as QuickDraw, to display the actual windows and menus on the computer screen 29.
As indicated by the dashed lines in FIG. 1, prior implementations of tear-off menus have required what may be described as a bifurcated event loop in which there are basically two paths for menu-related events: one through the Menu Manager for normal menu selection and one through the Window Manager for tear-off menus.
Not only do tear-off menus require developers to write custom MDEFs, they also require developers to implement custom support for floating windows in their applications. A floating window is one that always remains in the front-most window layer and can never be covered up by another window. This task has required intimate knowledge of the system software. No mechanism has existed to automatically support the menu-to-window transition. Next computers use a hybrid menu-palette in place of the usual application menus. The hybrid menu-palettes, however, are not "tear-off-able"; that is, they do not exhibit the dual behavior of first being anchored and then being torn off. The AUX (Apple Unix) operating system implements menus as windows. Again, tear-off menus are not explicitly supported.
What is needed, then, is a mechanism that explicitly supports tear-off menus in an efficient way that requires a minimum of application involvement.